import urllib.request as urlreq
#输入代理IP及接口

proxyHost = '223.242.221.39:17029'
#输入浏览网页地址
url = "https://nb.zu.anjuke.com/fangyuan/yinzhou/p1/"
#设置代理
ph = urlreq.ProxyHandler({'https': 'https://'+proxyHost,'http': 'http://' + proxyHost})
oper = urlreq.build_opener(ph)
#设置头信息
headers = ('User-Agent', 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Mobile Safari/537.36')
oper.addheaders = [headers]
#headers = ('aaa','aaa')
#oper.addheaders = [headers]
#headers = ('bbb','bbb')
#oper.addheaders = [headers]
#提交请求
res = oper.open(url)
print(res.read())

